{% extends 'front/front_base.html' %}
{% from 'common/_macros.html' import static %}
{% block title -%}
    查询结果展示
{%- endblock %}

{% block head -%}
    <link rel="stylesheet" href="{{ static('front/css/front_search.css') }}">
{%- endblock %}

{% block body -%}
    <div class="lg-container">
        <div class="post-group">
            <ul class="post-list-group">
                    {% for post in posts %}
                        <li>
                            <div class="author-avatar-group">
                                <img src="{{ post.author.avatar or static('common/images/logo.png') }}" alt="">
                            </div>
                            <div class="post-info-group">
                                <p class="post-title">
                                    <a href="{{ url_for('front.pdetail', post_id=post.id) }}">{{ post.title }}</a>
                                    {% if post.highlight %}
                                        <span class="label label-danger">精华帖</span>
                                    {% endif %}
                                </p>
                                <p class="post-info">
                                    <span>作者:{{ post.author.username }}</span>
                                    <span>发表时间:{{ post.create_time|time_filter }}</span>
                                    <span>评论:{{ post.comments|length }}</span>
                                    <span>阅读:{{ post.readers|length }}</span>
                                </p>
                            </div>
                        </li>
                    {% else %}
                        <p>暂时没有搜索结果！</p>
                    {% endfor %}
            </ul>
            <div style="text-align: center;">
                {{ pagination.links }}
            </div>
        </div>
    </div>
    <div class="sm-container"></div>
{%- endblock %}